<template>
  <div class="message">
    <div v-show="flag" class="alert">
      {{ title }}
    </div>
  </div>
</template>
<script>
export default ({
  props: {
    title: { type: String, default: '登陆成功' },
    flag: { type: Boolean, default: false, },
  },
  watch: {
    flag(newl, old) {
      if (newl) {
        setTimeout(() => {
          this.$emit('update:flag', false)
        }, 1000);
      }
    }
  }
})
</script>
<style scoped>
.message {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 102;
}


</style>